import wx
class SearchView:
    def __init__(self,parent,uiManager):
        
        #---------------------------------------------------------
        # deep search
        self.deepSearchPanel = wx.Panel(parent, -1) 
        vDeepSearch = wx.BoxSizer(wx.VERTICAL);
        self.deepSearchPanel.SetSizer(vDeepSearch)
        
        
        vDeepSearchCtrl = wx.BoxSizer(wx.HORIZONTAL);

        btSearchIncludes = wx.Button(self.deepSearchPanel,-1,"Search in included files")
        btSearchLibs = wx.Button(self.deepSearchPanel,-1,"Search in all lib pathes")
        
        btIncludeComment = wx.CheckBox(self.deepSearchPanel,-1,"")
        
        deepSearchText = wx.TextCtrl(self.deepSearchPanel,-1,size=(400,1))
        vDeepSearchCtrl.Add(deepSearchText, 0,wx.EXPAND)
        vDeepSearchCtrl.Add(btSearchIncludes, 0,0)
        vDeepSearchCtrl.Add(btSearchLibs, 0,0)
        vDeepSearchCtrl.Add(wx.StaticText(self.deepSearchPanel,-1,"   Include comments in search "), 0,0)
        vDeepSearchCtrl.Add(btIncludeComment, 0,0)
        
        
        vDeepSearch.Add( vDeepSearchCtrl, 0,wx.EXPAND)
        
        
        deepSearchTree = wx.TreeCtrl(self.deepSearchPanel, 1, wx.DefaultPosition, (-1,-1), wx.TR_HIDE_ROOT|wx.TR_HAS_BUTTONS)
        
        deepSearchTree.Bind(wx.EVT_TREE_SEL_CHANGED, uiManager.OnDeepSearchTreeSelChanged)
        btSearchIncludes.Bind(wx.EVT_BUTTON, uiManager.OnDeepSearchIncludes)
        btSearchLibs.Bind(wx.EVT_BUTTON, uiManager.OnDeepSearchLibs)
        
        
        vDeepSearch.Add(deepSearchTree,-1,wx.EXPAND)
        #deepSearchText.Bind(wx.EVT_KEY_UP, uiManager.OnDeepSearch)
        uiManager.deepSearchText = deepSearchText
        uiManager.deepSearchTree = deepSearchTree
        uiManager.searchInComment = btIncludeComment
        
    def getView(self):
        return self.deepSearchPanel
    